<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<button></button>
		<button></button>
		<button></button>
		<button></button>
		<button></button>
		<button></button>
		<button></button>
		<button></button>
		<button></button>
		<button></button>
		<script type="text/javascript">
			function log()
			{
				console.log(window.event.type+"\t"+window.event.target.innerHTML)
			};
			
			var btns=document.querySelectorAll("button");
			for(var i=0;i<btns.length;i++){
				btns[i].innerHTML="按钮"+i;
				btns[i].onclick =log;
				btns[i].onmouseover =log;
				btns[i].onmouseenter =log;
				btns[i].onmouseout =log;
			}
		</script>
	</body>
</html>
